<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix='sec' uri='http://www.springframework.org/security/tags'%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<title>仓储中心</title>
	<script type="text/javascript" src="scripts/boot.js"></script>
    <style type="text/css">
	    html,body
	    {
	    	height:100%;
	    	margin:0;,padding:0;
	    }   
    </style>
</head>
<body>
	<div id="toolbar1" class="mini-toolbar" style="padding:2px;" align="right">
		<div class="toplogo"><img src="scripts/miniui/themes/default/images/layout/logo-cangcu.png" /></div>
        <a class="mini-button mini-button-iconTop" iconCls="icon-close" href="j_spring_cas_security_logout" plain="true" >退出</a>
    </div>
    
    <div class="mini-fit">
    <div class="mini-splitter" style="width:100%;height:100%;" borderStyle="border-top:none;">
    
    <div size="15%" showCollapseButton="true">
	    <table cellpadding="0" cellspacing="0" style="height:100%;width:100%;table-layout:fixed">
	        <tr>
	            <td style="width:30px;height:100%;">
	                <div class="leftNav">
	                    <div style="padding-top:20px;">
	                        <sec:authorize url='/cm_sys_manger.do'>
	                        <a class="leftNav-cm" title="话务中心" href="${urlPath}/cm"></a>
	                        </sec:authorize>
	                        <sec:authorize url='/om_sys_manger.do'>
	                        <a class="leftNav-om" title="订单中心" href="${urlPath}/om"></a>
	                        </sec:authorize>
	                        <sec:authorize url='/wm_sys_manger.do'>
	                        <a class="leftNav-wm selected" title="仓储中心" href="${urlPath}/wm"></a>
	                        </sec:authorize>
	                        <sec:authorize url='/fm_sys_manger.do'>
	                        <a class="leftNav-fm" title="财务中心" href="${urlPath}/fm"></a>
	                        </sec:authorize>
	                        <sec:authorize url='/mm_sys_manger.do'>
	                        <a class="leftNav-mm" title="媒体中心" href="${urlPath}/mm"></a>
	                        </sec:authorize>
	                        <sec:authorize url='/ss_sys_manger.do'>
	                        <a class="leftNav-ss" title="统计中心" href="${urlPath}/ss"></a>
	                        </sec:authorize>
	                        <sec:authorize url='/hm_sys_manger.do'>
	                        <a class="leftNav-hm" title="人资中心" href="${urlPath}/hm"></a>
	                        </sec:authorize>
	                        
	                    </div>
	                </div>
	            </td>
	            <td style="height:100%;">
					<div class="mini-outlookmenu" style="height:100%;width:100%;" expandOnLoad="false" borderStyle="border:0;border-left:1px solid #95bae7" idField="id" parentField="pid" textField="text" url="loadMenu.do" onitemclick="itemclick">
                   	</div>
	            </td>
	        </tr>
	    </table>
    </div>
    <div style="background:#ececec;">
        <!--Tabs-->
        <div id="mainTabs" class="mini-tabs bg-toolbar" contextMenu="#tabsMenu" activeIndex="0" style="width:100%;height:100%;" bodyStyle="border:0;background:white;">        
            <div name="first" title="首页" style="width:100%;height:100%;">
            	<div class="mini-toolbar" style="border-bottom:0;padding:0px;width:99.8%;">
				    <table>
				        <tr>
				            <td>
				                <span>库存不足提醒</span>
				            </td>
				        </tr>
				    </table>           
				</div>
            	<div id="datagrid1" class="mini-datagrid" showPager="false" showVGridLines="false" idField="id" url="in_stock_warn.do" multiSelect="true" style="width:100%;height:30%;">
					<div property="columns" >
						<div type="indexcolumn"></div>
						<div field="medicineSerialNum" width="20%" headerAlign="center" align="center">药品编号</div>
						<div field="medicineName" width="30%" headerAlign="center" align="center">药品名称</div>
						<div field="medicineUnit" width="10%" headerAlign="center" align="center">单位</div>
						<div field="warehouseName" width="25%" headerAlign="center" align="center">所在仓库</div>
						<div field="quantity" width="15%" headerAlign="center" align="center">剩余数量</div>
					</div>
				</div>
            </div>
        </div> 
        <ul id="tabsMenu" class="mini-contextmenu" onbeforeopen="onBeforeOpen">        
	        <li onclick="refreshTab">刷新标签页</li>                
	        <li onclick="closeTab">关闭标签页</li>                
		    <li onclick="closeAll">关闭所有标签页</li>        
	        <li onclick="closeAllButFirst">关闭其他标签页</li>   
    	</ul>
    </div>
    </div>
    </div>
    
    <div title="south" region="south" showSplit="false" showHeader="false" height="30" >
        <div style="line-height:28px;text-align:center;">Copyright ©北京傲天飞宏科技有限公司</div>
    </div>
    
<script type="text/javascript">

	mini.parse();
	
	var grid = mini.get("datagrid1");
	grid.load();
	
    var tabs = mini.get("mainTabs");
	function showTab(node) {
	    var id = "tab$" + node.id;
	    var tab = tabs.getTab(id);
	    if (!tab) {
	        tab = {};
	        tab.name = id;
	        tab.title = node.text;
	        tab.showCloseButton = true;
	        tab.url = node.url;
	        tab.refreshOnClick= true;
	        tabs.addTab(tab);
	    } else {
	    	tabs.reloadTab(tab);
	    }
	    tabs.activeTab(tab);
	}       

    var currentTab = null;

    function onBeforeOpen(e) {
        currentTab = tabs.getTabByEvent(e.htmlEvent);
        if (!currentTab) {
            e.cancel = true;                
        }
    }

    function refreshTab() {
    	tabs.reloadTab(currentTab);
    }
    
    function closeTab() {
    	if(currentTab.name != 'first'){
    		tabs.removeTab(currentTab);
    	}
    }
    
    function closeAll() {
    	tabs.removeAll(tabs.getTab("first"));
    }
    
    function closeAllButFirst() {
        var but = [currentTab];            
        but.push(tabs.getTab("first"));
        tabs.removeAll(but);
    }
    
	function itemclick(e) {
		showTab({id: e.item.id, text: e.item.text, url: e.item.url});
	}    
</script>
</body>
</html>
